package com.fish.anne.model;

import com.fish.anne.model.BaseObject;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

import java.io.Serializable;

@Entity
@Table(name="order_payment_cfg" )
public class OrderPaymentCfg extends BaseObject implements Serializable {
    private Long pcId;
    private String config;
    private String customName;
    private String description;
    private BigDecimal fee;
    private String payMemberId;
    private String payMethod;
    private String payPrivateKey;
    private String payType;
    private short showOrder;
    private String sellerEmail;

	private String alipayType;
    public String getSellerEmail() {
		return sellerEmail;
	}

	public void setSellerEmail(String sellerEmail) {
		this.sellerEmail = sellerEmail;
	}

	public String getAlipayType() {
		return alipayType;
	}

	public void setAlipayType(String alipayType) {
		this.alipayType = alipayType;
	}

	@Id   @GeneratedValue(strategy = GenerationType.AUTO)    
    public Long getPcId() {
        return this.pcId;
    }
    
    public void setPcId(Long pcId) {
        this.pcId = pcId;
    }
    
    @Column(name="config", nullable=false)
    public String getConfig() {
        return this.config;
    }
    
    public void setConfig(String config) {
        this.config = config;
    }
    
    @Column(name="custom_name", nullable=false, length=100)
    public String getCustomName() {
        return this.customName;
    }
    
    public void setCustomName(String customName) {
        this.customName = customName;
    }
    
    @Column(name="description", nullable=false)
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    @Column(name="fee", nullable=false, precision=9, scale=5)
    public BigDecimal getFee() {
        return this.fee;
    }
    
    public void setFee(BigDecimal fee) {
        this.fee = fee;
    }
    
    @Column(name="pay_member_id", nullable=false, length=50)
    public String getPayMemberId() {
        return this.payMemberId;
    }
    
    public void setPayMemberId(String payMemberId) {
        this.payMemberId = payMemberId;
    }
    
    @Column(name="pay_method", nullable=false, length=50)
    public String getPayMethod() {
        return this.payMethod;
    }
    
    public void setPayMethod(String payMethod) {
        this.payMethod = payMethod;
    }
    
    @Column(name="pay_private_key", nullable=false, length=50)
    public String getPayPrivateKey() {
        return this.payPrivateKey;
    }
    
    public void setPayPrivateKey(String payPrivateKey) {
        this.payPrivateKey = payPrivateKey;
    }
    
    @Column(name="pay_type", nullable=false, length=30)
    public String getPayType() {
        return this.payType;
    }
    
    public void setPayType(String payType) {
        this.payType = payType;
    }
    
    @Column(name="show_order", nullable=false)
    public short getShowOrder() {
        return this.showOrder;
    }
    
    public void setShowOrder(short showOrder) {
        this.showOrder = showOrder;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        OrderPaymentCfg pojo = (OrderPaymentCfg) o;

        if (config != null ? !config.equals(pojo.config) : pojo.config != null) return false;
        if (customName != null ? !customName.equals(pojo.customName) : pojo.customName != null) return false;
        if (description != null ? !description.equals(pojo.description) : pojo.description != null) return false;
        if (fee != null ? !fee.equals(pojo.fee) : pojo.fee != null) return false;
        if (payMemberId != null ? !payMemberId.equals(pojo.payMemberId) : pojo.payMemberId != null) return false;
        if (payMethod != null ? !payMethod.equals(pojo.payMethod) : pojo.payMethod != null) return false;
        if (payPrivateKey != null ? !payPrivateKey.equals(pojo.payPrivateKey) : pojo.payPrivateKey != null) return false;
        if (payType != null ? !payType.equals(pojo.payType) : pojo.payType != null) return false;
 
        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (config != null ? config.hashCode() : 0);
        result = 31 * result + (customName != null ? customName.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (fee != null ? fee.hashCode() : 0);
        result = 31 * result + (payMemberId != null ? payMemberId.hashCode() : 0);
        result = 31 * result + (payMethod != null ? payMethod.hashCode() : 0);
        result = 31 * result + (payPrivateKey != null ? payPrivateKey.hashCode() : 0);
        result = 31 * result + (payType != null ? payType.hashCode() : 0);
 
        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("pcId").append("='").append(getPcId()).append("', ");
        sb.append("config").append("='").append(getConfig()).append("', ");
        sb.append("customName").append("='").append(getCustomName()).append("', ");
        sb.append("description").append("='").append(getDescription()).append("', ");
        sb.append("fee").append("='").append(getFee()).append("', ");
        sb.append("payMemberId").append("='").append(getPayMemberId()).append("', ");
        sb.append("payMethod").append("='").append(getPayMethod()).append("', ");
        sb.append("payPrivateKey").append("='").append(getPayPrivateKey()).append("', ");
        sb.append("payType").append("='").append(getPayType()).append("', ");
        sb.append("showOrder").append("='").append(getShowOrder()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
